<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:c="http://java.sun.com/jsp/jstl/core" >
      
   <head>
  </head> 
    <ui:composition template="/templates/default/template.xhtml">
    	<ui:define name="body">
    	
    	<h:panelGrid columns="1" style="margin-left:5px;width:100%">
    	<!--  tieu de -->
    	<h:panelGrid columns="3" styleClass="columPanelbaritemTitle">
			<h:graphicImage value="/templates/default/images/left-heading_01.jpg" style="margin-left:-4px;margin-bottom:0px"></h:graphicImage>
	  		<h:outputText value="Quản lý thành viên" styleClass="panelbaritemTitle"></h:outputText>
			<h:graphicImage value="/templates/default/images/left-heading_03.jpg"></h:graphicImage>
	  	</h:panelGrid>
	  	<!-- ket thuc tieu de -->
		<!-- phan noi dung phia duoi -->
    	<h:panelGrid columns="1" styleClass="panelGridBody">
    			<!-- Bat dau noi dung ben trong -->
		  <h:form>
		    <rich:panel style="background:#FFFFFF">
		    	<h:panelGrid columns="2" style="margin-left:10px;">
		    	    <h:outputText></h:outputText>
					<h:outputText id="idError" value="#{userQLTV.error}" style=" color: red;"></h:outputText>
					<h:outputText ></h:outputText>		    		
		    		<h:inputHidden value="#{userQLTV.id}"></h:inputHidden>
		    		<h:outputText  value="Tên đăng nhập (*):" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText  value="#{userQLTV.tenDangNhap}" styleClass="Input" id="idName" >
					</h:inputText>	
							
		    		<h:outputText  value="Họ tên:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText value="#{userQLTV.hoTen}" styleClass="Input"></h:inputText>		    		
		    		<h:outputText  value="Điện thoại:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText value="#{userQLTV.dienThoai}" styleClass="Input"></h:inputText>		    		
		    		<h:outputText  value="Hộp thư:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText value="#{userQLTV.hopThu}" styleClass="Input"></h:inputText>		    		
		    		<h:outputText  value="Địa chỉ:" style="margin-left:20px;" styleClass="inputText" ></h:outputText>
					<h:inputText value="#{userQLTV.diaChi}" styleClass="Input"></h:inputText>
		    		
		    	<!-- action -->	
		    	</h:panelGrid>
			    	<h:panelGrid columns="3" style="margin-left:120px;margin-top:10px">
			    	<a4j:commandButton value="Tìn kiếm" styleClass="Button" action="#{userQLTV.displayListUser}"></a4j:commandButton>
			    	<a4j:commandButton value="Lưu" styleClass="Button" action="#{userQLTV.save}" 
			    	 onclick="if(!confirm('Bạn có muốn lưu ?')) {return false;}" reRender="idError"></a4j:commandButton>
			        <a4j:commandButton  value="Reset" styleClass="Button" action="#{userQLTV.reset}"></a4j:commandButton>
			       </h:panelGrid>
		       <!-- ket thuc action -->
			 </rich:panel>
		  </h:form>
			<!-- Ket thuc phan noi dung ben trong -->
			
			<!-- Bat dau table -->
			<!-- 	<rich:panel style="background:none"> -->
			<h:form>
					<h:dataTable id="list" value="#{userQLTV.listUser}" var="user" 
								columnClasses="column" headerClass="TableHeader" rowClasses="ROW1,ROW2" footerClass="TableFooter" 
					       style="width:100%; margin-left:0px;margin-top: 10px" cellspacing="1px;" rows="10">
						<h:column >
							<f:facet name="header">
								<h:outputText value="STT"></h:outputText>
							</f:facet>
							<h:outputText value="#{user.stt}"></h:outputText>
							<f:facet name="footer">
								<rich:spacer></rich:spacer>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Họ tên"></h:outputText>
							</f:facet>
							<h:outputText value="#{user.hoTen}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Tên đăng nhập"></h:outputText>
							</f:facet>
							<h:outputText value="#{user.tenDangNhap}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Điện thoại"></h:outputText>
							</f:facet>
							<h:outputText value="#{user.dienThoai}"></h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Xóa" ></h:outputText>
							</f:facet>
							<a4j:commandLink  action="#{userQLTV.delete}"
											onclick="if(!confirm('Bạn có muốn xóa ?')) 
							 							{return false;}" reRender="idError">
								<h:graphicImage value="/quantri/pqcn/images/icoDelete.gif"></h:graphicImage>
								<f:param name="id" value="#{user.id}" />
							</a4j:commandLink>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sửa"></h:outputText>
							</f:facet>
							 <a4j:commandLink action="#{userQLTV.edit}">
							 	<h:graphicImage value="/quantri/pqcn/images/icoEdit.gif"></h:graphicImage>
							 	<f:param name="flag" value="edit" />
							 	<f:param name="id" value="#{user.id}" />
							 	<f:param name="tenDangNhap" value="#{user.tenDangNhap}" />
								<f:param name="matKhau" value="#{user.matKhau}" />
								<f:param name="xacNhanMK" value="#{user.xacNhanMK}" />
								<f:param name="hoTen" value="#{user.hoTen}" />
								<f:param name="dienThoai" value="#{user.dienThoai}" />
								<f:param name="hopThu" value="#{user.hopThu}" />
								<f:param name="diaChi" value="#{user.diaChi}" />
							 </a4j:commandLink>
						</h:column>
					</h:dataTable>
						<!-- phan trang -->
						<rich:datascroller align="right"  for="list" maxPages="5" />
						<!-- ket thuc phan trang -->
				</h:form>
				<!-- </rich:panel> -->
				<!--  Ket thuc table -->
    		</h:panelGrid>   
    		<!-- Ket thuc phan noi dung phia duoi --> 					
    	</h:panelGrid>
    	</ui:define>
    </ui:composition> 
    
</html>







